package com.example;

/**
 * @Auther: shiquan
 * @Date: 2024/10/13 - 10 - 13 -16:11
 */
public class Test4 {
    public static void main(String[] args) {
        //比较两个长方形的面积   并且输出最大
        //调用
        double area1=compare(5.3,1.7);
        double area2=compare(2.4,2.7);
        System.out.println("area1 = " + area1);
        System.out.println("area2 = " + area2);
        if (area1 > area2){
            System.out.println("第一个长方形更大");
        }else{
            System.out.println("第二个长方形更大");
        }
    }


    public static double compare(double len,double width){
        double area=len * width;
        return area;


    }
}

